package com.ruoyi.common.utils.excel;

import java.util.List;
import java.util.Map;

/**
 * Excel参数配置实体
 */
public class BaseExcelConfigEntity<T> {
    /** 导出文件名 */
    private String fileName = "export";
    /** 工作表名称 */
    private String sheetName = "sheet1";
    /** 标题行集合 */
    private Row titles;
    /** 尾行集合 */
    private Row endLines;
    /** 报表数据集合 */
    private List<?> tableData;
    /** 表头单元格配置 */
    private Row.Cell header;
    /** 数据单元格配置 */
    private Row.Cell dataCell;
    /** 列宽映射 */
    private Map<String,Double> columnWidthMap;
    /** 分组字段 */
    private String groupField;
    /** 是否已经排过序（为true时可能会造成数据行混乱） */
    private boolean sorted;
    /**
     * 排序类型依据，可选值（String,Integer,Long,Date）
     */
    private String sortedClass;

    /** 分组副标题 */
    private Row groupTitles;
    /** 分组副尾行 */
    private Row groupEndLines;
    /** 合计字段 */
    private String summaryField;
    /** 查询参数 */
    private T queryParams;

    public String getFileName() {
        return fileName;
    }

    public void setFileName(String fileName) {
        this.fileName = fileName;
    }

    public String getSheetName() {
        return sheetName;
    }

    public void setSheetName(String sheetName) {
        this.sheetName = sheetName;
    }

    public Row getTitles() {
        return titles;
    }

    public void setTitles(Row titles) {
        this.titles = titles;
    }

    public Row getEndLines() {
        return endLines;
    }

    public void setEndLines(Row endLines) {
        this.endLines = endLines;
    }

    public List<?> getTableData() {
        return tableData;
    }

    public void setTableData(List<?> tableData) {
        this.tableData = tableData;
    }

    public Row.Cell getHeader() {
        return header;
    }

    public void setHeader(Row.Cell header) {
        this.header = header;
    }

    public Row.Cell getDataCell() {
        return dataCell;
    }

    public void setDataCell(Row.Cell dataCell) {
        this.dataCell = dataCell;
    }

    public Map<String, Double> getColumnWidthMap() {
        return columnWidthMap;
    }

    public void setColumnWidthMap(Map<String, Double> columnWidthMap) {
        this.columnWidthMap = columnWidthMap;
    }

    public String getGroupField() {
        return groupField;
    }

    public void setGroupField(String groupField) {
        this.groupField = groupField;
    }

    public boolean isSorted() {
        return sorted;
    }

    public void setSorted(boolean sorted) {
        this.sorted = sorted;
    }

    public String getSortedClass() {
        return sortedClass;
    }

    public void setSortedClass(String sortedClass) {
        this.sortedClass = sortedClass;
    }

    public Row getGroupTitles() {
        return groupTitles;
    }

    public void setGroupTitles(Row groupTitles) {
        this.groupTitles = groupTitles;
    }

    public Row getGroupEndLines() {
        return groupEndLines;
    }

    public void setGroupEndLines(Row groupEndLines) {
        this.groupEndLines = groupEndLines;
    }

    public String getSummaryField() {
        return summaryField;
    }

    public void setSummaryField(String summaryField) {
        this.summaryField = summaryField;
    }

    public T getQueryParams() {
        return queryParams;
    }

    public void setQueryParams(T queryParams) {
        this.queryParams = queryParams;
    }

    /** 行对象 */
    public static class Row {
        /** 行高度 */
        private float height = 30;
        /** 单元格集合 */
        private List<Cell> cells;

        public float getHeight() {
            return height;
        }

        public void setHeight(float height) {
            this.height = height;
        }

        public List<Cell> getCells() {
            return cells;
        }

        public void setCells(List<Cell> cells) {
            this.cells = cells;
        }

        /** 单元格对象 */
        public static class Cell{
            /** 单元格宽度 */
            private double width = 12;
            /** 单元格高度 */
            private float height = 30;
            /** 字体 */
            private String fontFamily = "Arial";
            /** 字体大小 */
            private short fontSize = 12;
            /** 字体颜色 */
            private String fontColor = "BLACK";
            /** 单元格背景色 */
            private String backgroundColor = "WHITE";
            /** 横向对齐方式 */
            private String horizontalAlignment = "CENTER";
            /** 纵向对齐方式 */
            private String verticalAlignment = "CENTER";
            /** 上细线 */
            private boolean borderTop;
            /** 下细线 */
            private boolean borderBottom;
            /** 左细线 */
            private boolean borderLeft;
            /** 右细线 */
            private boolean borderRight;
            /** 横向占格数 */
            private int horizontalCellCount;
            /** 纵向占格数 */
            private Integer verticalCellCount;
            /** 是否与上一行合并 */
            private boolean joinWithLastRow;
            /** 单元格内容 */
            private Object cellValue;
            /** 日期格式 */
            private String dateFormat;

            public double getWidth() {
                return width;
            }

            public void setWidth(double width) {
                this.width = width;
            }

            public float getHeight() {
                return height;
            }

            public void setHeight(float height) {
                this.height = height;
            }

            public String getFontFamily() {
                return fontFamily;
            }

            public void setFontFamily(String fontFamily) {
                this.fontFamily = fontFamily;
            }

            public short getFontSize() {
                return fontSize;
            }

            public void setFontSize(short fontSize) {
                this.fontSize = fontSize;
            }

            public String getFontColor() {
                return fontColor;
            }

            public void setFontColor(String fontColor) {
                this.fontColor = fontColor;
            }

            public String getBackgroundColor() {
                return backgroundColor;
            }

            public void setBackgroundColor(String backgroundColor) {
                this.backgroundColor = backgroundColor;
            }

            public String getHorizontalAlignment() {
                return horizontalAlignment;
            }

            public void setHorizontalAlignment(String horizontalAlignment) {
                this.horizontalAlignment = horizontalAlignment;
            }

            public String getVerticalAlignment() {
                return verticalAlignment;
            }

            public void setVerticalAlignment(String verticalAlignment) {
                this.verticalAlignment = verticalAlignment;
            }

            public boolean isBorderTop() {
                return borderTop;
            }

            public void setBorderTop(boolean borderTop) {
                this.borderTop = borderTop;
            }

            public boolean isBorderBottom() {
                return borderBottom;
            }

            public void setBorderBottom(boolean borderBottom) {
                this.borderBottom = borderBottom;
            }

            public boolean isBorderLeft() {
                return borderLeft;
            }

            public void setBorderLeft(boolean borderLeft) {
                this.borderLeft = borderLeft;
            }

            public boolean isBorderRight() {
                return borderRight;
            }

            public void setBorderRight(boolean borderRight) {
                this.borderRight = borderRight;
            }

            public int getHorizontalCellCount() {
                return horizontalCellCount;
            }

            public void setHorizontalCellCount(int horizontalCellCount) {
                this.horizontalCellCount = horizontalCellCount;
            }

            public Integer getVerticalCellCount() {
                return verticalCellCount;
            }

            public void setVerticalCellCount(Integer verticalCellCount) {
                this.verticalCellCount = verticalCellCount;
            }

            public boolean isJoinWithLastRow() {
                return joinWithLastRow;
            }

            public void setJoinWithLastRow(boolean joinWithLastRow) {
                this.joinWithLastRow = joinWithLastRow;
            }

            public Object getCellValue() {
                return cellValue;
            }

            public void setCellValue(Object cellValue) {
                this.cellValue = cellValue;
            }

            public String getDateFormat() {
                return dateFormat;
            }

            public void setDateFormat(String dateFormat) {
                this.dateFormat = dateFormat;
            }
        }
    }
}
